<template>
  <van-nav-bar
    @click-left="router.back()"
    placeholder
    fixed
    :left-text="leftText"
    :left-arrow="showLeft"
  >
    <template #right>
      <slot></slot>
    </template>
    <template #title>
      <div class="title">{{ title }}</div>
    </template>
  </van-nav-bar>
</template>

<script setup>
defineProps(['title', 'leftText', 'showLeft'])

import { useRouter } from 'vue-router'

const router = useRouter()
</script>

<style scoped lang="less">
.title {
  color: @default-color;
}
:v-deep(.van-nav-bar .van-icon) {
  color: @default-color;
}
</style>
